package model

import (
	"food-mgr/food-service/configs"
	"gorm.io/gorm"
)

type Rider struct {
	gorm.Model
	UserId  int    `gorm:"type:int(11);comment:用户ID"`
	BizId   int    `gorm:"type:int(11);comment:商家ID"`
	OrderId int    `gorm:"type:int(11);comment:订单ID"`
	Status  string `gorm:"type:varchar(30);comment:骑手接单状态"`
	Count   int    `gorm:"type:int(11);comment:配送单数"`
}

func CreateRider(r *Rider) error {

	return configs.DB.Create(&r).Error
}
func ListRider(r *[]Rider) error {

	return configs.DB.Order("count DESC").Find(&r).Error
}
